<f:view xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pm="http://primefaces.org/mobile" contentType="text/html"
	renderKitId="PRIMEFACES_MOBILE"
	xmlns:bjs="http://java.sun.com/jsf/composite/bjs">

	<pm:page title="Bundesjugendspiele - Eingabefrontend">
		<h:outputScript name="/primefaces.js" library="primefaces" />
		<script type="text/javascript" src="js/contentType.js" />
		<link rel="stylesheet" href="css/style.css" type="text/css" />
		<!-- Main View -->
		<pm:view id="main">
			<h:form id="mainForm">
				<pm:header>
					<h1>
						<h:outputText rendered="#{riegenBean.config.existing}"
							id="mainHeader" value="#{msg.stationsauswahl}" />
						<h:outputText rendered="#{!riegenBean.config.existing}"
							id="mainHeaderSetup" value="Setup" />
					</h1>
				</pm:header>




				<pm:content>

					<p:outputPanel rendered="#{!riegenBean.config.existing}">
						<h:outputText value="#{msg.firstRunNotice}" />
						<h:outputLabel value="#{msg.hostNotice}" for="host" />
						<p:inputText id="host" value="#{configBean.host}" />
						<h:outputLabel value="#{msg.nameNotice}" for="name" />
						<p:inputText id="name" value="#{configBean.name}" />
						<h:outputLabel value="#{msg.portNotice}" for="port" />
						<p:inputText id="port" value="#{configBean.port}" />
						<p:commandButton actionListener="#{configBean.createConfig}"
							update="@all" value="Speichern" />
					</p:outputPanel>

					<p:outputPanel id="pass" rendered="#{riegenBean.config.existing}">
						<p>
							<h:outputText value="#{loginBean.text}" />
						</p>
						<h:outputLabel value="#{msg.username}" for="userName" />
						<p:inputText id="userName" value="#{loginBean.username}" />
						<h:outputLabel value="#{msg.password}" for="password" />
						<p:inputText id="password" value="#{loginBean.password}" />
						<p:commandButton actionListener="#{loginBean.login}"
							value="Speichern" update=":mainForm:pass"
							action="#{loginBean.login}" />
					</p:outputPanel>

				</pm:content>
			</h:form>
		</pm:view>

		<pm:view id="stationsauswahl">
			<h:form id="stationsForm">
				<pm:header>
					<h1>
						<h:outputText id="mainHeaderSetup" value="#{msg.stationsauswahl}" />
					</h1>
				</pm:header>

				<pm:content>

					<p:dataList value="#{riegenBean.disciplines}" var="discipline">

						<p:commandLink value="#{msg[discipline]}"
							update=":riegenForm:riegenHeader :riegenForm:riegenContent"
							action="pm:riegen?transition=slide">
							<f:setPropertyActionListener value="#{discipline}"
								target="#{riegenBean.discipline}" />
						</p:commandLink>

					</p:dataList>

				</pm:content>
			</h:form>
		</pm:view>

		<!-- Main View -->
		<pm:view id="riegen">
			<h:form id="riegenForm">

				<pm:header>
					<f:facet name="left">
						<p:button value="#{msg.back}" icon="back"
							href="#stationsauswahl?transition=slide&amp;reverse=true" />
					</f:facet>
					<h1>
						<h:outputText id="riegenHeader" value="#{msg.riegenauswahl}" />
					</h1>
				</pm:header>


				<pm:content>


					<p:outputPanel id="riegenContent">

						<p:dataList value="#{riegenBean.riegen}" var="riege">
							<p:column>
								<p:commandLink value="#{msg.riege} #{riege}"
									update=":schuelerListeForm:schuelerListeHeader :schuelerListeForm:schuelerListeContent"
									action="pm:schuelerListe?transition=slide">

									<f:setPropertyActionListener value="#{riege}"
										target="#{riegenBean.choosedRiegeID}" />
								</p:commandLink>
							</p:column>
						</p:dataList>
					</p:outputPanel>

				</pm:content>
			</h:form>
		</pm:view>



		<pm:view id="schuelerListe">
			<h:form id="schuelerListeForm">



				<pm:header>
					<f:facet name="left">
						<p:button value="#{msg.back}" icon="back"
							href="#riegen?transition=slide&amp;reverse=true" />
					</f:facet>
					<h1>
						<h:outputText id="schuelerListeHeader"
							value="Riege #{riegenBean.choosedRiegeID}" />
					</h1>
				</pm:header>
				<pm:content>
					<p:outputPanel id="schuelerListeContent">
						<p:dataList value="#{riegenBean.schuelerList}" var="schueler">
							<p:column>
								<p:commandLink
									value="#{schueler.ID} #{schueler.firstName} #{schueler.lastName}"
									update=":schuelerEditForm:schuelerEditHeader :schuelerEditForm:schuelerEditContent"
									action="pm:schuelerEdit?transition=slide">
									<f:setPropertyActionListener value="#{schueler.ID}"
										target="#{riegenBean.choosedSchuelerID}" />
								</p:commandLink>
							</p:column>
						</p:dataList>

					</p:outputPanel>
				</pm:content>
			</h:form>
		</pm:view>


		<pm:view id="schuelerEdit">
			<h:form id="schuelerEditForm">



				<pm:header styleClass="header">
					<f:facet name="left">
						<p:button value="#{msg.back}" icon="back"
							href="#schuelerListe?transition=slide&amp;reverse=true" />
					</f:facet>

					<h1>
						<h:outputText id="schuelerEditHeader"
							value="#{riegenBean.choosedSchueler.firstName} #{riegenBean.choosedSchueler.lastName}" />
					</h1>
				</pm:header>

				<pm:content>

					<p:outputPanel layout="block" id="schuelerEditContent">
						<h:outputText
							value="#{msg.currentPoints} #{riegenBean.choosedSchueler.points}" />
						<p:commandButton value="#{msg.saveNext}" id="schuelerEditSubmitA"
							actionListener="#{riegenBean.nextSchueler}"
							update=":schuelerEditForm:schuelerEditHeader :schuelerEditForm:schuelerEditContent" />
						<bjs:entry listEntries="#{riegenBean.editView.firstEntries}"
							title="#{msg[riegenBean.editView.firstTitle]}" />
						<bjs:entry listEntries="#{riegenBean.editView.secondEntries}"
							title="#{msg[riegenBean.editView.secondTitle]}" />
						<bjs:entry listEntries="#{riegenBean.editView.thirdEntries}"
							title="#{msg[riegenBean.editView.thirdTitle]}" />
						<bjs:entry listEntries="#{riegenBean.editView.fourthEntries}"
							title="#{msg[riegenBean.editView.fourthTitle]}" />







					</p:outputPanel>

				</pm:content>

			</h:form>
		</pm:view>







	</pm:page>

</f:view>

